﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GO_Test_1.Components;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GO_Test_1 {

	public static class GoManager {

		public static void AddBlock(Texture2D texture, Vector2 position, int width, int height, Color? color = null) {
			Guid id = Guid.NewGuid();
			ComponentManager.IDs.Add(id);
			ComponentManager.Types.Add(id, GoType.Block);
			ComponentManager.Positions.Add(id, position);
			ComponentManager.BoundingBoxes.Add(id, new Rectangle((int) position.X, (int) position.Y, width, height));
			ComponentManager.Appearances.Add(id, new Appearance {Texture = texture, Color = color != null ? color.Value : Color.White});
		}

		public static void AddBall(Texture2D texture, Vector2 position, Movement movement, int width, int height, Color? color = null) {
			Guid id = Guid.NewGuid();
			ComponentManager.IDs.Add(id);
			ComponentManager.Types.Add(id, GoType.Ball);
			ComponentManager.Positions.Add(id, position);
			ComponentManager.Movements.Add(id, movement);
			ComponentManager.BoundingBoxes.Add(id, new Rectangle((int) position.X, (int) position.Y, width, height));
			ComponentManager.Appearances.Add(id, new Appearance {Texture = texture, Color = color != null ? color.Value : Color.White});
		}

	}

}